// 假设已有 interface 定义： aru_ub_rdgen_cfg_if, ub_rd_req_if, aru_ub_dat_if, aru_payload_if

module tb_top;
    // clock / reset
    logic clk;
    logic rst_n;

    initial begin
        clk = 0;
        forever #5 clk = ~clk;
    end
    initial begin
        rst_n = 0;
        #20 rst_n = 1;
    end

    // instantiate interface instances
    logic ub_wr_rsp_vld;
    logic gm_wr_rsp_vld;
    is_instr_if u_is_aru_instr_if_inst ();
    done_if u_done_if_inst ();
    aru_ub_rd_req_if aru_ub_rd_req_if_inst ();
    aru_ub_dat_if aru_ub_dat_if_inst ();
    psb_rd_req_if psb_rd_req_if_inst ();
    aru_psb_dat_fp32_if aru_psb_dat_fp32_if_inst ();
    aru_ub_wr_req_if aru_ub_wr_req_if_inst ();
    aru_gm_wr_req_if aru_gm_wr_req_if_inst ();
    // DUT 实例化：把 interface instance 传进去（匹配 modport 类型）
    aru dut (
        .clk                  (clk),
        .rst_n                (rst_n),
        .ub_wr_rsp_vld        (ub_wr_rsp_vld),
        .gm_wr_rsp_vld        (gm_wr_rsp_vld),
        .u_is_aru_instr_if    (u_is_aru_instr_if_inst),
        .u_done_if            (u_done_if_inst),
        .u_aru_ub_rd_req_if   (aru_ub_rd_req_if_inst),
        .u_aru_ub_dat_if      (aru_ub_dat_if_inst),
        .u_psb_rd_req_if      (psb_rd_req_if_inst),
        .u_aru_psb_dat_fp32_if(aru_psb_dat_fp32_if_inst),
        .u_aru_ub_wr_req_if   (aru_ub_wr_req_if_inst),
        .u_aru_gm_wr_req_if   (aru_gm_wr_req_if_inst)
    );

    // （可选）在 tb 里驱动接口信号，或在接口内写 driver/monitor task/class
    initial begin
        #1000 $finish;
    end
endmodule
